package org.example;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.Reader;
import java.util.Properties;

/**
 * @author TonySong
 * @date 2025/7/30 0030
 * @time 16:06
 */
public class Test4 {
    public static void main(String[] args) throws Exception {
//         IFly f=new Bird();//SuperMan();
//         f.fly();
         //已收到代码是超人的实现，如果需求发生了变化(需要手动的修改代码：这个是不合理：开闭原则)


        Properties properties =new Properties();
        Reader reader=new FileReader("fly.properties");
        properties.load(reader);
        String className=properties.getProperty("className");
        IFly f = FlyFactory.createFly(className);
        f.fly();
    }
}
